package com.wutuo.wtservice.provider.dao;

import com.wutuo.wtservice.api.request.ListUserServiceRequest;
import com.wutuo.wtservice.api.request.UserServiceRequest;
import com.wutuo.wtservice.api.response.UserServiceResponse;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.SelectProvider;

import java.util.List;


/**
 * 服务关系表 Dao 层
 *
 * @author lvh
 * @version 1.0
 */
public interface UserServiceMapper extends BaseUserServiceMapper {
    @SelectProvider(type = UserServiceSqlProvider.class, method = "lisForPage")
    @ResultType(value = UserServiceResponse.class) List<UserServiceResponse> lisForPage(
        ListUserServiceRequest request);

    @SelectProvider(type = UserServiceSqlProvider.class, method = "list")
    @ResultType(value = UserServiceResponse.class) List<UserServiceResponse> list(
        UserServiceRequest request);

    /**
     * 根据花名册删除服务表
     *
     * @param rosterId
     * @return int
     * @author lvh 2016年2月3日 下午12:22:57</br>
     */
    @Delete({"delete from user_service where roster_id = #{rosterId,jdbcType=BIGINT}"})
    int deleteUserServiceByrosterId(@Param("rosterId") Long rosterId);
}